<script setup>
import { useRouter } from 'vue-router';

const router = useRouter()
const goHome = () => {
  router.push('/?a=123&b=456')
}
const goLogin = () => {
  router.push('/login')
}

</script>

<template>
  <div>vue3</div>
  <button @click="goHome">去首页</button>
  <button @click="goLogin">去登录页</button>

  <ul>
    <li>
      <router-link to="/">首页</router-link>
    </li>
    <li>
      <router-link to="/login">登陆</router-link>
    </li>
  </ul>

  <!-- 放出路由出口 -->
  <RouterView></RouterView>
</template>

<style>

</style>
